Optimal. Leaf size=74 \[ -\frac {\csc ^2(e+f x)}{2 (a+b) f}-\frac {b^2 \log \left (b+a \cos ^2(e+f x)\right )}{2 a (a+b)^2 f}-\frac {(a+2 b) \log (\sin (e+f x))}{(a+b)^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4223, 457, 90}
\begin {gather*} -\frac {b^2 \log \left (a \cos ^2(e+f x)+b\right )}{2 a f (a+b)^2}-\frac {\csc ^2(e+f x)}{2 f (a+b)}-\frac {(a+2 b) \log (\sin (e+f x))}{f (a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 457
Rule 4223
Rubi steps
\begin {align*} \int \frac {\cot ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {x^5}{\left (1-x^2\right )^2 \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\text {Subst}\left (\int \frac {x^2}{(1-x)^2 (b+a x)} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {1}{(a+b) (-1+x)^2}+\frac {a+2 b}{(a+b)^2 (-1+x)}+\frac {b^2}{(a+b)^2 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\csc ^2(e+f x)}{2 (a+b) f}-\frac {b^2 \log \left (b+a \cos ^2(e+f x)\right )}{2 a (a+b)^2 f}-\frac {(a+2 b) \log (\sin (e+f x))}{(a+b)^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.27, size = 100, normalized size = 1.35 \begin {gather*} -\frac {(a+2 b+a \cos (2 (e+f x))) \left (a (a+b) \csc ^2(e+f x)+2 a (a+2 b) \log (\sin (e+f x))+b^2 \log \left (a+b-a \sin ^2(e+f x)\right )\right ) \sec ^2(e+f x)}{4 a (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 119, normalized size = 1.61
method | result | size |
derivativedivides | \(\frac {-\frac {b^{2} \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 \left (a +b \right )^{2} a}+\frac {1}{\left (4 a +4 b \right ) \left (\cos \left (f x +e \right )-1\right )}+\frac {\left (-a -2 b \right ) \ln \left (\cos \left (f x +e \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {1}{\left (4 a +4 b \right ) \left (1+\cos \left (f x +e \right )\right )}+\frac {\left (-a -2 b \right ) \ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}}{f}\) | \(119\) |
default | \(\frac {-\frac {b^{2} \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 \left (a +b \right )^{2} a}+\frac {1}{\left (4 a +4 b \right ) \left (\cos \left (f x +e \right )-1\right )}+\frac {\left (-a -2 b \right ) \ln \left (\cos \left (f x +e \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {1}{\left (4 a +4 b \right ) \left (1+\cos \left (f x +e \right )\right )}+\frac {\left (-a -2 b \right ) \ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}}{f}\) | \(119\) |
risch | \(-\frac {i x}{a}+\frac {2 i a x}{a^{2}+2 a b +b^{2}}+\frac {2 i a e}{f \left (a^{2}+2 a b +b^{2}\right )}+\frac {4 i b x}{a^{2}+2 a b +b^{2}}+\frac {4 i b e}{f \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 i b^{2} x}{a \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 i b^{2} e}{a f \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 \,{\mathrm e}^{2 i \left (f x +e \right )}}{f \left (a +b \right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) a}{f \left (a^{2}+2 a b +b^{2}\right )}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{f \left (a^{2}+2 a b +b^{2}\right )}-\frac {b^{2} \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{2 a f \left (a^{2}+2 a b +b^{2}\right )}\) | \(285\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 90, normalized size = 1.22 \begin {gather*} -\frac {\frac {b^{2} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{3} + 2 \, a^{2} b + a b^{2}} + \frac {{\left (a + 2 \, b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{2} + 2 \, a b + b^{2}} + \frac {1}{{\left (a + b\right )} \sin \left (f x + e\right )^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.70, size = 131, normalized size = 1.77 \begin {gather*} \frac {a^{2} + a b - {\left (b^{2} \cos \left (f x + e\right )^{2} - b^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) - 2 \, {\left ({\left (a^{2} + 2 \, a b\right )} \cos \left (f x + e\right )^{2} - a^{2} - 2 \, a b\right )} \log \left (\frac {1}{2} \, \sin \left (f x + e\right )\right )}{2 \, {\left ({\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} f \cos \left (f x + e\right )^{2} - {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{3}{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 294 vs.
\(2 (70) = 140\).
time = 0.51, size = 294, normalized size = 3.97 \begin {gather*} -\frac {\frac {4 \, b^{2} \log \left (a + b + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{3} + 2 \, a^{2} b + a b^{2}} + \frac {4 \, {\left (a + 2 \, b\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {{\left (a + b + \frac {4 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {8 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} {\left (\cos \left (f x + e\right ) - 1\right )}} - \frac {8 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a} - \frac {\cos \left (f x + e\right ) - 1}{{\left (a + b\right )} {\left (\cos \left (f x + e\right ) + 1\right )}}}{8 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.94, size = 98, normalized size = 1.32 \begin {gather*} \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a\,f}-\frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{2\,f\,\left (a+b\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a+2\,b\right )}{f\,\left (a^2+2\,a\,b+b^2\right )}-\frac {b^2\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}{2\,a\,f\,{\left (a+b\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________